<?php
// index.php - 修复版本
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Global Food Market - Taste the World</title>
    <link rel="stylesheet" href="css/style.css">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
    <!-- 简化版头部用于测试 -->
    <header style="background: #2c5530; color: white; padding: 1rem 0;">
        <div class="container">
            <div style="display: flex; justify-content: space-between; align-items: center;">
                <div>
                    <h1 style="margin: 0; font-size: 1.75rem;">Global Food Market</h1>
                    <p style="margin: 0; opacity: 0.8;">Taste the World</p>
                </div>
                <nav>
                    <a href="products.php" style="color: white; text-decoration: none; margin-left: 1rem; padding: 0.5rem 1rem; background: rgba(255,255,255,0.2); border-radius: 4px;">
                        Products
                    </a>
                    <a href="admin/login.php" style="color: white; text-decoration: none; margin-left: 1rem; padding: 0.5rem 1rem; background: #e67e22; border-radius: 4px;">
                        Admin
                    </a>
                </nav>
            </div>
        </div>
    </header>

    <!-- Hero Section -->
    <section style="background: linear-gradient(135deg, #2c5530 0%, #1e3a23 100%); color: white; padding: 4rem 0; text-align: center;">
        <div class="container">
            <h1 style="font-size: 3rem; margin-bottom: 1rem;">Discover Authentic Flavors</h1>
            <p style="font-size: 1.25rem; margin-bottom: 2rem; opacity: 0.9;">From around the world to your doorstep</p>
            <a href="products.php" style="display: inline-block; background: #e67e22; color: white; padding: 1rem 2rem; border-radius: 8px; text-decoration: none; font-weight: 600;">
                Shop Now
            </a>
        </div>
    </section>

    <!-- 简单的产品展示 -->
    <section style="padding: 3rem 0;">
        <div class="container">
            <h2 style="text-align: center; margin-bottom: 2rem; color: #2c5530;">Featured Products</h2>
            
            <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem;">
                <!-- 产品卡片1 -->
                <div style="background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
                    <div style="height: 200px; overflow: hidden;">
                        <img src="https://images.unsplash.com/photo-1565299624946-b28f40a0ca4b?w=400&auto=format&fit=crop&q=60" 
                             alt="Sichuan Chili Oil" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <div style="padding: 1.5rem;">
                        <span style="font-size: 0.875rem; color: #6c757d; text-transform: uppercase;">Sauces</span>
                        <h3 style="margin: 0.5rem 0; color: #333;">Sichuan Chili Oil</h3>
                        <p style="color: #6c757d; margin-bottom: 1rem;">Authentic Sichuan style chili oil with rich aroma</p>
                        <div style="display: flex; justify-content: space-between; align-items: center;">
                            <div>
                                <span style="font-size: 1.25rem; font-weight: 700; color: #2c5530;">$14.39</span>
                                <span style="text-decoration: line-through; color: #6c757d; margin-left: 0.5rem;">$15.99</span>
                            </div>
                            <button style="background: #2c5530; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer;">
                                Add to Cart
                            </button>
                        </div>
                    </div>
                </div>

                <!-- 产品卡片2 -->
                <div style="background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
                    <div style="height: 200px; overflow: hidden;">
                        <img src="https://images.unsplash.com/photo-1571091718767-18b5b1457add?w=400&auto=format&fit=crop&q=60" 
                             alt="Japanese Matcha KitKat" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <div style="padding: 1.5rem;">
                        <span style="font-size: 0.875rem; color: #6c757d; text-transform: uppercase;">Snacks</span>
                        <h3 style="margin: 0.5rem 0; color: #333;">Japanese Matcha KitKat</h3>
                        <p style="color: #6c757d; margin-bottom: 1rem;">Premium matcha green tea flavored chocolate</p>
                        <div style="display: flex; justify-content: space-between; align-items: center;">
                            <span style="font-size: 1.25rem; font-weight: 700; color: #2c5530;">$8.50</span>
                            <button style="background: #2c5530; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer;">
                                Add to Cart
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <div style="text-align: center; margin-top: 2rem;">
                <a href="products.php" style="display: inline-block; background: #2c5530; color: white; padding: 1rem 2rem; border-radius: 8px; text-decoration: none; font-weight: 600;">
                    View All Products
                </a>
            </div>
        </div>
    </section>

    <!-- 简单的页脚 -->
    <footer style="background: #333; color: white; padding: 2rem 0; margin-top: 3rem;">
        <div class="container">
            <p style="text-align: center; margin: 0;">&copy; 2024 Global Food Market - ICTWEB513 Project</p>
        </div>
    </footer>
</body>
</html>